Trial app and in-app purchase sample


Windows Runtime
Store
Windows RT
en-US
11/25/2013

This sample demonstrates how to perform in-app feature or product purchases operations and use the licensing API provided by the Windows Store to determine the license status of an app or a feature that is enabled by an in-app purchase.

The sample app shows the different ways the licensing API can be used to perform the following tasks for an app.

  • Check the current license status of an app
  • Check the expiration date of a trial period
  • Check if an app's feature has been purchased through an in-app purchase
  • Perform an in-app purchase to buy the app
  • Perform an in-app purchase to buy an app feature or product
  • Perform an in-app purchase transaction using the Windows Store commerce platform.
  • Perform an in-app purchase to buy an app feature or product from a large purchase catalog.

To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.

To obtain an evaluation copy of Microsoft Visual Studio 2013, go to Visual Studio 2013.

Note  For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.

Related topics

Windows 8.1 Feature Guide for Developers: Store updates
How to create a trial version of your app
How to support in-app purchases from your app
Windows.ApplicationModel.Store
Windows 8 app samples

Related technologies

Windows.ApplicationModel.Store

Operating system requirements

Client
Windows 8.1
Server
Windows Server 2012 R2

Build the sample

This sample is designed for Windows 8.1. It will not build or run on earlier versions of Windows.

You can build and deploy both the retail and the debug versions of this app; however, only the retail version will pass the Windows App Certification Kit.

Run the sample

To run this sample app after you have built it successfully, deploy it to your computer. You can do this in Visual Studio 2013. From

  1. In the Solution Explorer, select the Store project.
  2. From the Build menu, select Build Solution.
  3. If the solution builds without errors or warnings, from the Build menu, select Deploy Solution.
  4. You should see the sample app in your Start screen. To run the app, click its tile in the Start screen.

This app simulates the license server in the Windows Store by using configuration files. Some of the examples illustrated in this app do not work more than one time. As such, it might be necessary to restart the program to see those examples work again.